﻿
$(document.body).ready(
    function() {
        $.ajax({
            url: "/Start/RootInfo/",
            success: function(data) {
                var infoItems = [];
                var roleText = "Роль";
                var logText = "Логин";
                var roleName = localStorage.getItem(roleText);
                infoItems.push({ Name: "Пользователь", Value: roleName });
                infoItems.push({ Name: roleText, Value: roleName });
                infoItems.push({ Name: logText, Value: localStorage.getItem("Логин") });
                $.each(data, function() {
                    infoItems.push(this);
                });
                var ul = $("<ul></ul>");
                $.each(infoItems, function() {
                    var li = $("<li></li>");
                    var itemText = this.Name + " : " + this.Value;
                    li.text(itemText);
                    li.appendTo(ul);
                });
                var div = $("div").filter(function(value) {
                    return value.id == "infoCont";
                });
                ul.appendTo("#infoCont");
            }
            }
        );
    }
);